#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

#include <errno.h>

#include <include/pf_errno.h>

const char* pf_strerror(int32_t error_number)
{
    return strerror(abs(error_number));
}

int32_t pf_errno(void)
{
    int32_t tmp = errno;
    return (tmp <= 0) ? tmp : -tmp;
}

int32_t pf_set_errno(int32_t error_number)
{
    int32_t tmp = errno;
    errno = (error_number <= 0) ? error_number : -error_number;
    return tmp;
}

const char* pf_last_error(void)
{
    int32_t tmp = errno;
    return strerror((tmp >= 0) ? tmp : -tmp);
}

